package com.wh.order.dao;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.wh.order.pojo.OrderList;
import com.wh.order.pojo.OrderProducid;
import com.wh.order.vo.OrderExportVo;
import com.wh.order.vo.OrderProductVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.time.LocalDateTime;
import java.util.List;

/**
* 后端Service接口；
*/
@Mapper
@Repository
public interface OrderListMapper extends BaseMapper<OrderList> {

    /**
     * 分页：查询当前页数据
     * @param page 分页参数
     * @param queryWrapper 查询条件
     * @return
     */
    List<OrderList> findByPage(@Param("page") IPage<OrderList> page,@Param("ew") QueryWrapper<OrderList> queryWrapper);

    
    void cancel(String orderSn, String reasonForCancellation, Integer orderState);

    void insertOrder(OrderList orderList);

    List<OrderList> getOrderDataByNowMonth(String currentYearMonth);

    List<OrderList> getOrderDataByNowYear(String year);

    List<OrderList> getOrderDataByNowWeek();
    void sendoutgoods(String receipt, String payType, String orderSn, String logisticsCompanies, String logisticsMethods, String trackingNumber, String Remarks, String voucher, Integer orderState, LocalDateTime deliveryTime);


    List<OrderList> findMyOrderByPage(@Param("page") IPage<OrderList> page,@Param("ew") QueryWrapper<OrderList> queryWrapper);

    OrderList findOne(@Param("orderSn") String orderSn);

    void Fail(String orderSn, Integer findingOfAudit, Integer failedCode);


    void FirstTrial(String orderSn, Integer code, Integer reviewer);

    void finaexamine(String orderSn, Integer code);

    Double getNowYearTotalAmount();

    Double getNowMonthTotalAmount();

    Double getNowWeekTotalAmount();

    Double getLastYearTotalAmount();

    Double getLastMonthTotalAmount();

    Double getLastWeekTotalAmount();

    List<OrderProductVo> getNowYearHotProduct();

    List<OrderProductVo> getNowMonthHotProduct();

    List<OrderProductVo> getNowWeekHotProduct();

    List<OrderExportVo> findAllExportOrder(@Param("orderSn") String[] orderSn);

    List<OrderExportVo> getOrdersBySnsAndColumns(@Param("orderSn") List<String> orderSn);

    List<OrderProducid> selectProduct(@Param("orderSn") List<String> orderSn);

    void importOrder(String orderSn, String trackingNumber);

    Boolean selectOrderSn(String orderSn);


    List<OrderList> customerServiceFindByPage(@Param("page") IPage<OrderList> page,@Param("ew") QueryWrapper<OrderList> queryWrapper);

    void editOrder(String orderSn, String payType, Integer paymentStatus, LocalDateTime lastOperaTime,String notes);

    void takeDelivery(LocalDateTime successTime, Integer orderstate, String orderSn);

    Long findpersonId(String orderSn);
}
